package com.yulongtian.offers.day202209.day20220905;

/**
 * https://leetcode.cn/problems/qing-wa-tiao-tai-jie-wen-ti-lcof?plan=lcof&plan_progress=g8d07hi
 * @author YulongTian
 * @date 2022/9/5 - 17:13
 */
public class Test09 {
    public static void main(String[] args) {

    }

    public int numWays(int n) {
        if(n<=1){
            return 1;
        }
        long a=1l;
        long b=1l;
        long c=a+b;

        for(int i=2;i<=n;i++){
            c=(a+b)%1000000007;
            a=b;
            b=c;
        }
        return (int)(c%1000000007);
    }
}
